package com.doudanhua.basecode.jackson.configurer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;

import java.io.IOException;

/**
 * @Author zhangqian
 * @Description TODO
 * @Date 2022/11/4 17:27
 */
//public class LazyGetFieldSerializer extends JsonSerializer<LazyGetField> implements JsonConfigurer {
//    @Override
//    public void serialize(LazyGetField value, JsonGenerator gen, SerializerProvider serializers) {
//        try {
//            gen.writeString(value.getClass().getSimpleName());
//        } catch (IOException exp) {
//            throw new RuntimeException("LazyGetFieldSerializer.serialize", exp);
//        }
//    }
//
//    @Override
//    public void config(ObjectMapper objectMapper) {
//        SimpleModule module = new SimpleModule(this.getClass().getSimpleName(), Version.unknownVersion());
//        module.addSerializer(LazyGetField.class, this);
//        objectMapper.registerModule(module);
//    }
//}
